home *** CD-ROM | disk | FTP | other *** search
- ┌───────────────────┐
- │ THE VGA18 LIBRARY │
- └───────────────────┘
-
- This library is a basis library of sprites functions for the
- VGA 18 mode, with 640 x 480 resolution.
- It hold 256 color (displayed as 16 color), F16, EAS sprite.
- All other sprite formats are included in the registered
- library that holds functions for bitmap 16 colors compressed or
- no.
- You also get the ASM source of this VGA 18 library with the
- registered version.
- Way in which a sprite is displayed depends both the chosen
- function and the VGA writing mode defined by the WRITEMODE
- function. This function sets the COPY, AND, OR or XOR logical
- modes for all further displays. Functions of sprite handles
- three drawing modes: COPY, OVER background, UNDER background.
- Sprites modes and VGA modes can be combined.
- In COPY mode, the background of the image of the sprite is put
- on the screen, in OVER mode, only the no black pixels are put
- on the screen, in UNDER mode, the no black pixels of the sprite
- replace the previous black pixels on the screen.
-
-
- VGA 18 library variables:
-
- BORDER OF THE GRAPHICAL WINDOW
- int XL18; Left border in pixels.
- int YT18; Top.
- int XR18; Right border in pixels.
- int YB18; Bottom.
- char XBL; Left border in bytes.
- char XBR; Right in bytes.
-
- extern char COLOR16; Current color.
-
- char PENCOL18; Text color.
- char PALETTE; Current palette number.
-
- char count; Internal variable.
- FILE *SF Internal variable.
-
-
- VGA 18 library functions.
-
- All sprite functions but MSPRITE display sprite from bottom to
- top of the screen.
-
- For functions having pixel coordinate,
- x = 0..639,
- y = 0..479.
- For functions with no boundary,
- x = 0..79.
- y = 0..479.
- The address is either the absolute address in memory of the
- sprite or value the GETSPspriteadr function of MCGALIB returns.
-
-
- void setscreen2(int mode);
- Set the screen resolution:
- 18 = VGA high resolution.
- 3 = Text mode.
-
- int VRTload(int x,int y,char *adr,char *name);
- Load and display a VRT screen. adr must point out a memory
- buffer size of which being that of the file.
-
- void writemode(int code);
- Set the VGA write mode. Codes for the 'code' variable are
- those of the VGA card, and no the same some languages use.
- 0 = COPY.
- 8 = AND.
- 16 = OR.
- 24 = XOR.
-
-
- void window18(int left,int top,int right,int bottom);
- Set the window borders.
-
- void cls18(int color);
- Clear the screen inside the windows, with the color (0..15).
-
- char *getspadr18(int ns);
- Get address of sprite number ns.
-
- void setpalvga(int col,int register);
- Set value "register" to the color.
- Value 0..63, color 0..15.
-
- void setallvga(unsigned char *paladdress);
- Set the 16 colors palette, with values the 'paladdress' va-
- riable
- points out. The field holds 17 numbers, the first is unused,
- the followings are values of the 16 colors. This don's change
- RGB registers, one can use MCGALIB functions for that.
-
- void write18(int x, int y,char *string);
- Put the string at x,y. With color PENCOL18.
- x = 1..80
- y = 1..30
-
- int getfast(int xl,int yt,int xr,int yb,char *BUFFER);
- Get a block of screen to BUFFER which must be previously
- allocate. Use fastsprite to put it on the screen.
-
- void fastsprite(int x,int y,char *spriteadr);
- Display a F16 sprite with no boundary, in COPY mode, and logi-
- cal mode according to the WRITEMODE setting.
-
- void fastspritec(int x,int y,char *spriteadr);
- The same function with window limits.
-
- void nbfastsprite(int x,int y,char *spriteadr,int code);
- Display a F16 sprite with pixel coordinate, in OVER drawing
- mode, with logical mode according to 'code'. Reset setting of
- the WRITEMODE function.
-
- void easprite(int x,int y,char *spriteadr);
- Display an EAS sprite, no boundary, with OVER drawing mode.
-
- void fasteasprite(int x,int y,char *spriteadr);
- As the previous one, with COPY drawing mode.
-
-
- void sp256(int x,int y,char *spriteadr);
- Display a 256 colors sprite, with pixel coordinate, with 16
- colors and OVER drawing mode.
-
- void sp256(int x,int y,char *spriteadr);
- The same function with window limits.
-
- void csp256(int x,int y,char *spriteadr);
- As the previous one, with COPY drawing mode.
- void icon18(int x,int y,char *spriteadr);
- Display an icon created with the i, j or k commands of MegaS-
- prites (with pixel coordinate).
-
- void csp256(int x,int y,char *spriteadr);
- The same function with window limits.
-
- void icon18(int x,int y,char *spriteadr);
- Display a 16 color icon. Color 9 is the background color.
-
-
- VGA18.OBJ
-
- The assembly 80286, VGA18.OBJ module can be linked to a pro-
- gram of any language, according to the instructions manual of
- the language gives.
- Using the C language, one may include the VGA18.h header. in
- the C source of the program.
- Option are:
- - Model large
- - Case-sensitive (-ml with Tasm).
-
-
- SPRTEST.C
- This example program show how to use some sprite functions pro-
- vided in the VGA18 library, with an automaton.
- The method I use here is the simplest: I put a sprite in COPY
- mode that erases himself the previous image. The black border
- of the sprite allows a shift of the image.
-
- Another simple method is to use the XOR mode with a reduced set
- of color inside the animation field. The best of all is the co-
- lor plane technique. More on all that with examples in the re-
- gistered version...
-
-